<?php
class CartPanel_TestController extends Swf_Controller_Action
{
	public function orderAction()
	{
		$client = new Zend_Soap_Client( 'http://cart.ext.dev:8001/cart/order/wsdl' );
		Zend_Debug::dump( $client->initOrder( 1 ));
		$this->_helper->layout->disableLayout();
		$this->_helper->viewRenderer->setNoRender();
	}
	public function initorderAction()
	{
		$client = new Cart_Order();
		$orderId = $client->getActiveOrder( 666 );
		$line = new stdClass();
		$line->sales_line_id = null;
		$line->product_id = 224;
		$line->product_type = 'books';
		$line->product_description = 'El dia menos pensado';
		$line->product_detail = 'libro de tapa blanda y barato';
		$line->ordered_quantity = 1;
		$line->unit_selling_price = 35;
		$line->unit_shipping_price = 5;
		$line->pcnt_tax = 15;
		$line->line_order = 1;
		$item = new Cart_VO_Line( $line );
		
		if( ! $client->addOrderLine( $orderId, $item )){
			Zend_Debug::dump( $item, "Hubo un error agregando la liena" );exit;
		}
		
		$client->setBillToAddress( $orderId, 1 );
		$client->setShipToAddress( $orderId, 2 );
		$client->setContactPhone( $orderId, '424942022' );
		$client->setPaymentMethod( $orderId, 1 );
		$client->setShippingMethod( $orderId, 2 );
		$client->payOrder( $orderId );
		
		
		$this->_helper->layout->disableLayout();
		$this->_helper->viewRenderer->setNoRender();
	}			
}